function test1()

N = 100;
z1 = zeros(N,N);
z2 = zeros(N,N);

for i = 1:N,
    for j = 1:N,
        c = (i-1)*(1/N) + eps;
        delta = (j-1)*(1/N) + eps;
        if (delta > c)
            if ((delta -c) >= delta^2)
                z1(j,i) = 1;
            elseif ((delta -c) < (2/3)*delta^2 )
                z1(j,i) = 2;
            elseif ((delta -c) < delta^2 )
                z1(j,i) = 3;            
            end
        elseif (delta < c)
            if ((c-delta) < (2/3)*delta^2)
                z1(j,i) = 8;            
            elseif ((c-delta) <= delta^2)
                z1(j,i) = 6;            
            elseif (((c-delta) <= 2*delta^2) & ((c-delta) > delta^2))
                z1(j,i) = 7;
            else
                z1(j,i) = 5;            
            end 
        else
            z1(j,i) = 4;            
        end
    end
end

for i = 1:N,
    for j = 1:N,
        c = (i-1)*(1/N) + eps;
        delta = (j-1)*(1/N) + eps;
        if (delta > c)
           z2(j,i) = 1;
        elseif (delta < c)
           z2(j,i) = 2;            
        else
           z2(j,i) = 3;
        end
    end
end


ROOT_FOLDER='/home_fedora/test_ground/matlab/';
lineProperties = '-xk';
lineWidth = 2;
fontsize = 28;
fontname = 'Helvetica';
fontweight = 'n';
plotType = '';
ciLevel = -1; 
barColor = 'r';

xAxisBound=0:0.05:1;% This is based on the number of rows and columns of z1
yAxisBound=0:0.05:1;% This is based on the number of rows and columns of z1
colorbarTickPositions=[1.5 2.3 3.1 4 4.9 5.8 6.7 7.6]; % depends on the number of unique elements - NEED TO BE HARDCODED
colorbarTickLabels={'1(a)','1(b)','1(c)','(2)','(3a)', '(3b)', '(3c)', '(3d)'}; % depends on the number of unique elements  - NEED TO BE HARDCODED
plotgraph(z1, 'Illustration of results in Table 1', 'fig1', xAxisBound, yAxisBound, ...
          true, 8, colorbarTickPositions, colorbarTickLabels);


xAxisBound=0:0.05:1;% This is based on the number of rows and columns of z1
yAxisBound=0:0.05:1;% This is based on the number of rows and columns of z1
colorbarTickPositions=[1 2 3 ]; % depends on the number of unique elements - NEED TO BE HARDCODED
colorbarTickLabels={'A','B','C',}; % depends on the number of unique elements  - NEED TO BE HARDCODED
plotgraph(z2, 'density (\gamma) = 0', 'fig2', xAxisBound, yAxisBound, ...
          true, 3, colorbarTickPositions, colorbarTickLabels);
      
      
function figure_handle=plotgraph(matrixToPlot, figureLabel, fileName, ...
                                 xAxisBound, yAxisBound, useColorBar,noOfColors, colorbarTickPositions, colorbarTickLabels)

figure_handle = figure('Name',figureLabel,'NumberTitle','off');
set(gca,'FontName','Helvetica','FontAngle','italic', 'FontSize', fontsize);  

if (useColorBar==0)
    colormap(gray);
    imagesc(xAxisBound, yAxisBound, 1-matrixToPlot);
else
    % colormap(gray);
    % colormap(hsv(6))
    b =     [ 0.0 1.0 1.0;
            0.5 1.0 0.5;
            1.0 1.0 0.0;
            1.0 0.5 0.0;
            1.0 0.0 0.0;
            1.0 0.0 1.0];
    % colormap(b);
    colormap(jet(noOfColors));    
    imagesc(xAxisBound, yAxisBound, matrixToPlot);
    
    hcb = colorbar('Location','EastOutside');
    set(hcb, 'YTickMode','manual');
    set(hcb, 'YTickLabelMode','manual');
    set(hcb,'FontName','Helvetica','FontAngle','italic', 'FontSize', 16);      

    set(hcb, 'YTick',colorbarTickPositions);
    set(hcb , 'YTickLabel', colorbarTickLabels);
end

set(gca,'YDir','normal');
% set (gca, 'XTick', 0:0.2:1);
% set (gca, 'YTick', 0:0.2:1);

title(figureLabel);
h = get(gca, 'title');
tempfontsize = fontsize;
fontsize = 24;
set(h, 'FontName', 'Helvetica', 'FontSize', fontsize);
fontsize = tempfontsize;

ylabel('benefit (\delta)','fontsize',fontsize,'fontweight',fontweight, 'fontname', fontname);
xlabel('cost (c)','fontsize',fontsize,'fontweight',fontweight, 'fontname', fontname);
% saveas(figure_handle,strcat(ROOT_FOLDER, fileName),'eps'); % -- FOR GRAY
% SCALE IMAGES
 saveas(figure_handle,strcat(ROOT_FOLDER, fileName),'epsc2');
end

end